import 'package:flutter/material.dart';

class WrapPage extends StatelessWidget {
  const WrapPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.all(10),
      child: Wrap(
        direction: Axis.horizontal,
        spacing: 8, // X轴间距
        runSpacing: 16, // Y轴间距
        children: (() {
          List<Widget> list = [];
          for (var i = 0; i < 20; i++) {
            list.add(
              ElevatedButton(
                onPressed: () => {},
                child: Text('第 $i 集'),
              ),
            );
          }
          return list;
        })(),
      ),
    );
  }
}
